<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> - 基本表单</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="../favicon.ico">
    <link href="/Public/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link rel="stylesheet" href="/Public/css/ace.min.css"/>
    <link href="/Public/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/Public/css/animate.css" rel="stylesheet">
    <link href="/Public/css/style.css?v=4.1.0" rel="stylesheet">
    <style type="text/css">
        th {
            text-align: center;
        }
    </style>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>绩效统计-
                        <small>外呼记录</small>
                    </h5>
                    <div class="ibox-tools">
                        <form method="get" action="<{$SRVER_NAME}>/admin.php/Achievements/kf_call_out" class="pull-right mail-search">
                            <div class="input-group">
                                <input type="hidden" value="<{$search.type}>" name="type">
                                <input type="hidden" value="<{$search.name}>" name="name">
                                <input type="hidden" value="<{$search.s_time}>" name="s_time">
                                <input type="hidden" value="<{$search.e_time}>" name="e_time">
                                <input type="text" class="form-control input-sm" name="key" placeholder="搜索/手机号/沟通内容"
                                       value="<{$search.key}>">
                                <div class="input-group-btn">
                                    <button type="submit" class="btn btn-sm btn-primary">
                                        搜索
                                    </button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="ibox-content" id="copy_div" oncopy="copyfunc()">

                    <table class="table table-striped table-bordered table-hover" id="sample-table">
                            <tr>
                                <th>用户名</th>
                                <th>手机号</th>
                                <th>接听时间</th>
                                <th>结束时间</th>
                                <th>接听状态</th>
                                <th>备注</th>
                                <th>语音</th>
                            </tr>
                            <volist name="data" id="vo">
                                <tr>
                                    <td><{$vo.truename}></td>
                                    <td><{$vo.mobile}></td>
                                    <td><{$vo.begin}></td>
                                    <td><{$vo.end}></td>
                                    <td><{$vo.state}></td>
                                    <td><{$vo.content}></td>
                                    <td> <a class='audio'><audio  src='<{$vo.voice_url}>' controls='controls'></audio></a> </td>
                                </tr>
                            </volist>
                    </table>
                    <div class="dataTables_paginate paging_simple_numbers">
                        <ul class="pagination">
                            <if condition="$tol gt 10">
                                <{$fpage}>
                            </if>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="/Public/js/jquery.min.js?v=2.1.4"></script>
<script src="/Public/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/Public/js/content.js?v=1.0.0"></script>
<script src="/Public/admin/js/layer/layer.js"></script>
<script src="/Public/admin/js/layui/layui.js"></script>
<script>

    function copyfunc() {
        var url = "<{$SRVER_NAME}>/admin.php/AntiUser/copy_record";
        var content = document.getElementById("copy_div").innerHTML;
        var type = "<{$type}>";
        var c_type = 0;
        if (type == 2) {
            c_type = 3;
        } else if (type == 1) {
            c_type = 4;
        } else if (type == 3) {
            c_type = 5;
        }

        $.post(url, {content: content, type: c_type}, function (data) {
            if (data.code == "1001") {

            }
            else {

            }

        });
    }

    var playing = false, currentAudio = null;
    $(".audio").on("click", function () {
        console.log('1212');
        var $audio = $(this).find("audio");
        if (playing) {
            playing = false;
            currentAudio.pause();
            currentAudio.currentTime = 0;
            currentAudio = null;
        }
        playing = true;
        currentAudio = $audio.get(0);
        currentAudio.play();
    });
</script>
</body>
</html>
